import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
} from '@nestjs/common';
import { SysPostService } from './sys-post.service';
import { CreateSysPostDto } from './dto/create-sys-post.dto';
import { UpdateSysPostDto } from './dto/update-sys-post.dto';

@Controller('sys-post')
export class SysPostController {
  constructor(private readonly sysPostService: SysPostService) {}

  @Post()
  create(@Body() createSysPostDto: CreateSysPostDto) {
    return this.sysPostService.create(createSysPostDto);
  }

  @Get()
  findAll() {
    return this.sysPostService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.sysPostService.findOne(+id);
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateSysPostDto: UpdateSysPostDto) {
    return this.sysPostService.update(+id, updateSysPostDto);
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.sysPostService.remove(+id);
  }
}
